function Promise(executor){
	// 状态
	this.state="pending";
	// 状态值
	this.result = undefined;
	// 子函数一般以下划线开头
	const _onResolved = function(value){
		if(this.state !== "pending") return;
		// 将状态更改为fulfilled,成功值更改为接收的参数
		this.state = "fulfilled";
		this.result = value;
	}
	const _onRejected = function(value){
		if(this.state !== "pending") return;
		this.state = "rejected";
		this.result = value;
	}
	try{
		executor(_onResolved.bind(this),_onRejected.bind(this));
	}catch (err){
		_onRejected.call(this,err);
	}
}
export default Promise;